
Ext.define('Pearlsen.tree.PPanel', {
	 extend:'Ext.tree.Panel',
	 alias: 'widget.ptreepanel',
	 viewConfig:{
		 /***
		  * 勾选联动选中
		  * @param e
		  * @param t
		  */
         onCheckboxChange : function(e, t) {
             var item = e.getTarget(this.getItemSelector(), this.getTargetEl()), record;  
             if (item) {
                 record = this.getRecord(item);  
                 var check = !record.get('checked');  
                 record.set('checked', check);  
                 if (check) {
                     record.bubble(function(parentNode) {parentNode.set('checked', true);});  
                     record.cascadeBy(function(node) {node.set('checked', true);});  
                 } else {
                     record.cascadeBy(function(node) {node.set('checked', false);});  
                 }
             }
         }
     }
	 
});